package com.wjb.xietong.server;

import org.json.JSONException;
import org.json.JSONObject;

import com.wjb.xietong.util.IDs;
import com.wjb.xietong.util.LogD;


public class HeaderInfoResponse extends BaseResponseDataParse{
	
	private String errorCode = null;
	private String errorMsg = null;
	//返回结果
	private boolean responResult = false; // true:成功 false:失败
	
	
	@Override
	public boolean parseJsonObj(JSONObject response) {
		if(null == response){
			LogD.output("response is null");
			return false;
		}
		
		try {
			setResponResult(checkRespCode(response));
			if(response.has(IDs.ERROR_CODE)){
				setErrorCode(response.getString(IDs.ERROR_CODE));
			}
			if(response.has(IDs.ERROR_MSG)){
				setErrorMsg(response.getString(IDs.ERROR_MSG));
			}
		} catch (JSONException e) {
			LogD.output("Exception:" + e.getMessage());
			return false;
		}
		
		return true;
	}
	
	public boolean isResponResult() {
		return responResult;
	}

	public void setResponResult(boolean responResult) {
		this.responResult = responResult;
	}

	public String getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}
	public String getErrorMsg() {
		return errorMsg;
	}
	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	@Override
	public void initData() {
		// TODO Auto-generated method stub
		
	}
	
	
}
